﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO.Ports;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ZK.HardWareBLL;

namespace ZK.YHP_TransManage.Test
{
    public partial class _232串口服务器测试 : Form
    {

        NRCOMServerBLL bLL;
        Socket client;
        public _232串口服务器测试()
        {
            InitializeComponent();

            var ports = SerialPort.GetPortNames();
            Common.DelegateHelper.NRA9Event += nRA9Event1;
        }

        private void nRA9Event1(decimal weight)
        {
            this?.Invoke(new Action(() => {
                textBox1.Text = textBox1.Text + weight + "-";
            }));
        }


        //set

        //init
        private void button4_Click(object sender, EventArgs e)
        {
            Models.TerminalM terminalM = new Models.TerminalM();
            terminalM.ip = textBoxIp.Text;
            terminalM.port = Convert.ToInt32(textBoxPort.Text);
            bLL = new NRCOMServerBLL(terminalM);
            Common.ShowBlackBox.WriteLine("1 init is success");

        }


    }
}
